package com.xuhaijian.controller;

import com.xuhaijian.annotation.LogInputOutput;
import com.xuhaijian.model.OrderPayment;
import com.xuhaijian.model.dto.OrderPaymentDto;
import com.xuhaijian.service.OrderPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class TestController {

    @Autowired
    private OrderPaymentService orderPaymentService;

    @RequestMapping("/hello")
    public String hello(){
        return "helloWord";
    }

    @RequestMapping("/queryData/{applyNo}")
    @LogInputOutput
    public List<OrderPayment> queryData(@PathVariable String applyNo){
        return orderPaymentService.listByCondition(applyNo);
    }

    @RequestMapping("/queryDataByParam")
    public List<OrderPayment> queryDataByParam(){
        String path = "D:/java/helloword/springboot-helloword/src/main/resources/req.json";
        return orderPaymentService.queryDataByParam(path);
    }
}
